Refactor RAG from agent-level config to standard toolset type#2210
Draft
dgageot wants to merge 4 commits intodocker:mainfrom
Draft
Refactor RAG from agent-level config to standard toolset type#2210dgageot wants to merge 4 commits intodocker:mainfrom
dgageot wants to merge 4 commits intodocker:mainfrom
Conversation
rumpl
reviewed
Mar 22, 2026
Replace the special-cased RAG configuration (AgentConfig.RAG []string referencing top-level Config.RAG map) with a standard toolset type (type: rag) that follows the same patterns as MCP and other toolsets. Key changes: - Add 'type: rag' to toolset registry with ref support for shared definitions - Introduce RAGToolset wrapper (mirrors MCPToolset) for top-level rag section - Add RAGConfig field to Toolset for inline/resolved RAG configuration - Add resolveRAGDefinitions() mirroring resolveMCPDefinitions() - Extract rag.NewManager() for per-toolset manager creation - Implement tools.Startable on RAGTool for lazy init and file watching - Remove RAG special-casing from Team, LocalRuntime, and teamloader - Add v6→v7 migration for old rag agent field to toolset entries - Update schema, docs, and all example YAML files Assisted-By: docker-agent
The PR docker#2210 moved RAG from agent-level config to standard toolset type (tools.Startable) but removed the event forwarding that showed indexing progress in the TUI sidebar. This restores event forwarding by: - Adding an EventCallback to RAGTool that forwards rag.Manager events during Start() initialization - Having StartBackgroundRAGInit discover RAG tools from agent toolsets and wire up the event callback before initialization happens - Converting RAG manager events (indexing started/progress/completed, usage, errors) back to runtime events for the TUI Assisted-By: docker-agent
Signed-off-by: David Gageot <david.gageot@docker.com>
- Remove RAGInitializer interface and StartBackgroundRAGInit indirection. RAG event callbacks are now wired in configureToolsetHandlers alongside other handler setup, using the same pattern as Elicitable/OAuthCapable. - Remove deprecated NewManagers wrapper (no callers after toolset refactor). - Clean up RAGTool: unexport internal types (QueryRAGArgs, QueryResult), inline sortResults, remove verbose debug logging from Tools(), simplify handleQueryRAG. Assisted-By: docker-agent
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Replace the special-cased RAG configuration (AgentConfig.RAG []string referencing top-level Config.RAG map) with a standard toolset type (type: rag) that follows the same patterns as MCP and other toolsets.
Key changes:
Assisted-By: docker-agent